import { defineConfig } from 'vite'
import path from 'path';
import svgr from "vite-plugin-svgr";
import react from '@vitejs/plugin-react-swc';

// https://vitejs.dev/config/
export default defineConfig({
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  plugins: [
    svgr(),
    react(),
  ],
  define: {
    __BUILD_TIMESTAMP__: new Date().getTime(),
  },
  server: {
    host: '0.0.0.0',
    port: 80,
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:3100',
        changeOrigin: true,
      },
    }
  }
})
